import VueRouter from "vue-router";
import Home from '../components/Home.vue'

const routes = [
    {
        path: "/",
        component: Home
    },
    {
        path: "/preview/:chart/",
        component: () => import("../components/Preview"),
        children: [
            {
                path: "legend/basic",
                component: () => import("../components/echarts/legend/Index")
            },
            {
                path: "legend/item-style",
                component: () => import("../components/echarts/legend/ItemStyle")
            },
            {
                path: "x-axis",
                component: () => import("../components/echarts/xAxis/Index")
            },
            {
                path: "y-axis",
                component: () => import("../components/echarts/yAxis/Index")
            },
            {
                path: "series",
                component: () => import("../components/echarts/series/bar/Index")
            },
        ]
    }

]

const router = new VueRouter({
    routes // short for `routes: routes`
})

export default router